package com.meihua.shellapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.meihua.shellapp.fragment.ClassroomFragment;
import com.meihua.shellapp.fragment.QueryFragment;
import com.meihua.shellapp.fragment.TestFragment;

import java.util.ArrayList;


public class PioneerViewPagerAdapter extends FragmentPagerAdapter{
//    String[] tabs = {"微课堂","在线测试","咨询服务","直播间"};
    String[] tabs = {"微课堂","在线测试","咨询服务"};
    ArrayList<Fragment> fragments = new ArrayList(){
        {
            add(new ClassroomFragment());
            add(new TestFragment());
            add(new QueryFragment());
//            add(new LiveFragment());
        }
    };
    public PioneerViewPagerAdapter(FragmentManager fm) {
        super(fm);
    }
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabs[position];
    }

    @Override
    public int getCount() {
        return tabs.length;
    }
}
